import request from '@/utils/request'
import defaultSettings from '@/settings'

export const apiUrlConfig = {
  queryUrl: `${defaultSettings.ctx.authorityApp}/s/configInfo/search`,
  exportUrl: `${defaultSettings.ctx.authorityApp}/s/configInfo/search`,
  delUrl: `${defaultSettings.ctx.authorityApp}/s/configInfo/remove`,
  //editUrl: ``
}

//用户选择机构数据
export const userDeptRoleConfig = {
  queryUrl: `${defaultSettings.ctx.authorityApp}/s/afterLogin/selectVueLoginDeptPre`,
  //editUrl: ``
}

// export function userDeptRole() {
//   return request({
//     url: `${defaultSettings.ctx.authorityApp}/s/afterLogin/selectVueLoginDeptPre`,
//     method: 'get'
//   })
// }

//已某个机构登录
export function loginByDeptId(credentialId) {
  return request({
    url: `${defaultSettings.ctx.authorityApp}/s/afterLogin/selectVueLoginDept?credentialId=` + credentialId,
    method: 'get'
  })
}

// 查询部门下拉树结构
export function treeselect(userId,deptId,deptCode,tenantCode,name) {
  return request({
    url: `${defaultSettings.ctx.authorityApp}/s/deptInfo/queryDeptTreeDataVue?userId=`+userId+`&deptId=`+deptId+`&deptCode=`+deptCode+`&tenantCode=`+tenantCode+`&name=`+name,
    method: 'get',
  })
}

// 查询部门下拉树结构
export function selectDeptByIdVue(deptId) {
  return request({
    url: `${defaultSettings.ctx.authorityApp}/s/deptInfo/selectDeptByIdVue?deptId=`+deptId,
    method: 'get',
  })
}
